treeview: Don't get separator_height more than once
authorTimm Bäder <mail@baedert.org>
Tue, 15 Jan 2019 15:26:13 +0000 (16:26 +0100)
committerTimm Bäder <mail@baedert.org>
Wed, 16 Jan 2019 17:58:15 +0000 (18:58 +0100)
Closes !209

gtk/gtktreeview.c

index dc3107722097c176a7bec256c59dfae0888fdbbf..01f30f5450282bfd058208ed2e8a5346c9497a9f 100644 (file)
@@ -5545,6 +5545,7 @@ validate_row (GtkTreeView   *tree_view,
   gboolean is_separator = FALSE;
   gboolean draw_vgrid_lines, draw_hgrid_lines;
   gint expander_size;
+  int separator_height;
 
   /* double check the row needs validating */
   if (! GTK_TREE_RBNODE_FLAG_SET (node, GTK_TREE_RBNODE_INVALID) &&
@@ -5573,6 +5574,8 @@ validate_row (GtkTreeView   *tree_view,
        first_column = first_column->next)
     ;
 
+  separator_height = get_separator_height (tree_view);
+
   context = gtk_widget_get_style_context (GTK_WIDGET (tree_view));
   gtk_style_context_save (context);
   gtk_style_context_add_class (context, GTK_STYLE_CLASS_CELL);
@@ -5604,7 +5607,7 @@ validate_row (GtkTreeView   *tree_view,
 
       if (is_separator)
         {
-          height = get_separator_height (tree_view);
+          height = separator_height;
         }
       else
         {